﻿<UserControl x:Class="MathematicallySafe.HeadCounter.Views.RaidersView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Views="clr-namespace:MathematicallySafe.HeadCounter.Views"
    Initialized="RaidersViewInitialized">
    
    <UserControl.Resources>
        
    </UserControl.Resources>
    
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0" Background="{StaticResource DefaultBackground}"
          TextElement.Foreground="{StaticResource DefaultForeground}" TextElement.FontFamily="Corbel" TextElement.FontSize="14" >

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <ListView Name="listViewRaiders" Grid.Row="1" Grid.Column="0" MaxWidth="450"
                  ItemContainerStyle="{StaticResource ListViewItemStyle}" ItemsSource="{Binding Path=Raiders}" SelectedItem="{Binding SelectedRaider}" >
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="NaN" CellTemplate="{StaticResource RaiderNameAttendanceFlaggedCellTemplate}" Header="RAIDER"/>
                    <GridViewColumn Width="50" CellTemplate="{StaticResource AttendanceCellTemplate}" Header="ATT%"/>
                    <GridViewColumn Width="50" CellTemplate="{StaticResource LootCountCellTemplate}" Header="LOOT"/>
                    <GridViewColumn Width="65" CellTemplate="{StaticResource LifetimeWeightedLootRateCellTemplate}" Header="RATE"/>
                    <GridViewColumn Width="65" CellTemplate="{StaticResource GearScoreCellTemplate}" Header="GEAR"/>
                    <GridViewColumn Width="75" CellTemplate="{StaticResource LootPriorityCellTemplate}" Header="PRIORITY"/>
                </GridView>
            </ListView.View>
        </ListView>
        
        <Grid Grid.Row="1" Grid.Column="1" 
              Visibility="{Binding ElementName=listViewRaiders, Path=SelectedItem, Converter={StaticResource HiddenIfNull}}"
              DataContext="{Binding ElementName=listViewRaiders, Path=SelectedItem}" 
              TextElement.FontWeight="Normal">
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TabControl Grid.Row="0" Style="{StaticResource MainTabControl}">
                <TabItem Header="OVERVIEW" Style="{StaticResource MainTabControlItem}">
                    <Views:RaiderOverviewView Margin="0,-20,0,0" />
                </TabItem>
                <TabItem Header="GEAR" Style="{StaticResource MainTabControlItem}">
                    <Views:RaiderGearView x:Name="raiderGearView" Margin="0,-20,0,0" />
                </TabItem>
                <TabItem Header="ATTENDANCE" Style="{StaticResource MainTabControlItem}">
                    <Views:RaiderHistoryView Margin="0,-20,0,0" />
                </TabItem>
            </TabControl>
            
        </Grid>
    </Grid>
</UserControl>
